<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.5: http://docutils.sourceforge.net/" />
<title>Tiled maps</title>
<link rel="stylesheet" href="doc.css" type="text/css" />
</head>
<body>
<div class="document">
<div class="navigation navigation-header container">
<span class="previous">Previous: <a class="reference" href="transitions.html" title="Transitions">Transitions</a></span><span class="next">Next: <a class="reference" href="maps.html" title="Maps">Maps</a></span><span class="breadcrumbs"><a class="reference" href="index.html" title="Programming Guide">Programming Guide</a> » Tiled maps</span></div>
<h1 class="title">Tiled maps</h1>

<p>The cocos.tiles module provides a simple method of managing tiled displays
in 2D games.</p>
<p>Tile maps are made of three components:</p>
<dl class="docutils">
<dt>images</dt>
<dd>Images are from individual files for from image atlases in a single file.</dd>
<dt>tiles</dt>
<dd>Tiles may be stand-alone or part of a TileSet.</dd>
<dt>maps</dt>
<dd>MapLayers are made of either rectangular or hexagonal Cells which
reference the tiles used to draw the cell.</dd>
</dl>
<p>The intent is that you may have a tile set defined in one XML file
which is shared amongst many map files (or indeed within a single
XML file). Images may be shared amongst multiple tiles with the tiles
adding different meta-data in each case.</p>
<p>These may be constructed manually or loaded from XML resource files which
are used to store the specification of tile sets and tile maps. A given
resource XML file may define multiple tile sets and maps and may even
reference other external XML resource files. This would allow a single
tile set to be used by multiple tile maps.</p>
<p>A fairly simple example of using the cocos.tiles module is provider in
test/test_tiles.py</p>
<p>A basic tile map editor is provided in tools/editor.py</p>
<div class="navigation navigation-footer container">
<span class="previous">Previous: <a class="reference" href="transitions.html" title="Transitions">Transitions</a></span><span class="next">Next: <a class="reference" href="maps.html" title="Maps">Maps</a></span><span class="breadcrumbs"><a class="reference" href="index.html" title="Programming Guide">Programming Guide</a> » Tiled maps</span></div>
</div>
</body>
</html>
